package com.zl.csMall.basic.busFile.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zl.csMall.basic.busFile.po.BusFile;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.function.Function;

public interface BusFileService extends IService<BusFile> {


    /**
     * @description: 根据附件ID获取文件下载地址集合
     * @param attachmentId 附件ID
     * @return: 文件下载地址集合
     * @author ChenNing
     * @date: 2025-10-15 16:38
     */
    List<String> getDowUrlByAttachmentId(long attachmentId);

    /**
     * @description: 批量保存文件
     * @param attachmentId 附件ID
     * @param fileArr 文件数组
     * @return: 文件下载地址集合
     * @author ChenNing
     * @date: 2025-10-15 15:47
     */
    List<String> saveBatchBusFile(long attachmentId, MultipartFile[] fileArr);

    /**
     * @description: 根据ID删除文件
     * @param id 文件ID
     * @author ChenNing
     * @date: 2025-10-15 16:15
     */
    boolean deleteBFile(long id);

    /**
     * @description: 根据附件ID删除文件
     * @param attachmentId 附件ID
     * @author ChenNing
     * @date: 2025-10-20 10:55
     */
    boolean deleteByAttachmentId(long attachmentId);

    /**
     * @description: 判断该附件ID是否存在
     * @param attachmentId 附件ID
     * @return: true：存在
     * @author ChenNing
     * @date: 2025-10-21 10:50
     */
    boolean isExistenceToAttachmentId(Long attachmentId);

}
